#!/usr/bin/env python3
"""This is just a simple authentication example.

Please see the `OAuth2 example at FastAPI <https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/>`_  or
use the great `Authlib package <https://docs.authlib.org/en/v0.13/client/starlette.html#using-fastapi>`_ to implement a classing real authentication system.
Here we just demonstrate the NiceGUI integration.
"""

from json import load
from nicegui import app, ui

from views import page
from views.footer import FooterView
from views.header import HeaderView
from views.layout import LayoutView
from views.leftdrawer import LeftDrawerView
from views.login import LoginView
from views.register import RegisterView

from dotenv import load_dotenv

load_dotenv()
app.add_static_files("/imgs","imgs")
# @ui.page("/streetview")
# def streetview():    
#     left_drawer = LeftDrawerView().left_drawer
#     header = HeaderView(left_drawer)
#     footer = FooterView().footer
#     pager = page.PageView(footer)
    
# @ui.page("/")
# def main():
#     # ui to 
#     # ui.label("Hello, world!")
#     ui.navigate.to("login")
    
# @ui.page("/register")
# def register():
#     with ui.row().classes("w-full"):
#         ui.markdown("# 全球影像采集系统").classes("w-full text-center")
#     with ui.card().classes("w-1/2 mx-auto"):
#         ui.label("请注册")
#         user_name = ui.input("用户名")
#         user_passwd = ui.input("密码")
#         ui.input("确认密码")
#         with ui.row():
#             ui.button("注册")
#             ui.button("返回")
         
    
# @ui.page("/login")
# def login():
#     # 页面标题，全球影像采集系统
#     # ui.title("Global Image Collection System")
#     with ui.row().classes("w-full"):
#         ui.markdown("# 全球影像采集系统").classes("w-full text-center")
#     with ui.card().classes("w-1/2 mx-auto"):  # Add "mx-auto" class to center the card
#         ui.label("请登录")
#         ui.input("用户名")
#         ui.input("密码")
#         with ui.row():
#             ui.button("登录")
#             ui.button("注册")


@ui.page('/layout')
def layout():
    LayoutView()

@ui.page("/login")
def login():
   LoginView()
   
@ui.page("/register")
def register():
    RegisterView()
   
@ui.page("/")
def main():
    ui.navigate.to("login")

ui.run(host="0.0.0.0")